import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

np.random.seed(10)
x = np.random.rand(50)
y = np.random.rand(50)
sizes = 1000 * np.random.rand(50)
color = np.random.rand(50)
plt.figure(figsize=(10, 6))
plt.scatter(x, y, c=color, s=sizes, alpha=0.5, cmap='viridis_r')


plt.title('散点图示例')
plt.xlabel('x')
plt.ylabel('y')
plt.colorbar(label='颜色调')
plt.show()
